<?php

//$http_method = strtoupper($_SERVER['REQUEST_METHOD']);

$user_id = get_loggedin_userid();
$url = urldecode(get_input('url', ''));

if ($url === '') {
    echo json_encode(array("status" => 500, "message" => "url can not be empty!"));
    exit;
}

$ok = GgsSocialObjects::doUnLike($user_id, $url);

if ($ok) {
    echo json_encode(array("status" => 200, "message" => "ok"));
    exit;
}
echo json_encode(array("status" => 500, "message" => "fail"));
exit;
